package io.github.loserya.core.sdk.aggregate.entity;

import io.github.loserya.core.entity.SortCondition;
import org.springframework.data.mongodb.core.aggregation.AggregationOptions;
import org.springframework.data.mongodb.core.query.Query;

import java.util.ArrayList;
import java.util.List;

public class ParsedQuery<Q, R> {

    private final List<String> groupByField = new ArrayList<>();
    private final List<AggregationField> aggregations = new ArrayList<>();
    private final List<MogoField> fields = new ArrayList<>();
    private final List<SortCondition> sortConditions = new ArrayList<>();
    private Query whereClause;
    private Long skip = 0L;
    private Integer limit = 0;
    private Class<Q> clazz;
    private String collectionName;
    private AggregationOptions options;

    public Class<Q> getClazz() {
        return clazz;
    }

    public void setClazz(Class<Q> clazz) {
        this.clazz = clazz;
    }

    public String getCollectionName() {
        return collectionName;
    }

    public void setCollectionName(String collectionName) {
        this.collectionName = collectionName;
    }

    public ParsedQuery() {
    }

    public Long getSkip() {
        return skip;
    }

    public void setSkip(Long skip) {
        this.skip = skip;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public List<SortCondition> getSortConditions() {
        return sortConditions;
    }

    public List<String> getGroupByField() {
        return groupByField;
    }

    public List<AggregationField> getAggregations() {
        return aggregations;
    }

    public List<MogoField> getFields() {
        return fields;
    }

    public Query getWhereClause() {
        return whereClause;
    }

    public void setWhereClause(Query whereClause) {
        this.whereClause = whereClause;
    }

    public void options(AggregationOptions options) {
        this.options = options;
    }

    public AggregationOptions getOptions() {
        return options;
    }

    public void setOptions(AggregationOptions options) {
        this.options = options;
    }
}
